package org.power.core.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketAddress;

/**
 * Server
 *
 * @author 苗冬冬
 */
public class Server {
    /*public static void main(String[] args) throws IOException {
        ServerSocket server = new ServerSocket();
        SocketAddress address = new InetSocketAddress("127.0.0.1", 50000);
        server.bind(address);
        Socket socket = server.accept();
        InputStream is = socket.getInputStream();
        OutputStream out = null;
        byte[] bytes = new byte[2048];
        int len = 0;
        String results = null;
        try {
            len = is.read(bytes, 0, 2048);
            results = new String(bytes, 0, len);
            System.out.println("from Client information:" + results);
            out = socket.getOutputStream();
            out.write("J-S-P_ I am Server".getBytes());
        } catch (IOException e) {
            e.printStackTrace();
        }

        server.close();
        System.out.println("结束");

    }*/
}
